package com.s10.ecloud.web.model;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "ROLE", catalog = "ECLOUD")
public class Role implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private int id;

	private String name;

	private boolean query;

	private boolean control;

	private List<Integer> accessIds;

	public Role() {

	}

	@Id
	@GeneratedValue
	@Column(name = "ID", unique = true, nullable = false)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name = "NAME", unique = true, nullable = false)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Transient
	public List<Integer> getAccessIds() {
		return accessIds;
	}

	public void setAccessIds(List<Integer> accessIds) {
		this.accessIds = accessIds;
	}

	@Column(name = "CANQUERY", nullable = false)
	public boolean isQuery() {
		return query;
	}

	public void setQuery(boolean query) {
		this.query = query;
	}

	@Column(name = "CANCONTROL", nullable = false)
	public boolean isControl() {
		return control;
	}

	public void setControl(boolean control) {
		this.control = control;
	}
}
